package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.GraduationApplyRecordMapper;
import com.hgkj.cloud.base.domain.GraduationApplyRecord;
import com.hgkj.cloud.base.service.GraduationApplyRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class GraduationApplyRecordServiceImpl implements GraduationApplyRecordService {

    @Autowired
    private GraduationApplyRecordMapper graduationApplyRecordMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return graduationApplyRecordMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(GraduationApplyRecord record) {
        return graduationApplyRecordMapper.insert(record);
    }

    @Override
    public int insertSelective(GraduationApplyRecord record) {
        return graduationApplyRecordMapper.insertSelective(record);
    }

    @Override
    public GraduationApplyRecord selectByPrimaryKey(Long id) {
        return graduationApplyRecordMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(GraduationApplyRecord record) {
        return graduationApplyRecordMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(GraduationApplyRecord record) {
        return graduationApplyRecordMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Map<String, Object>> getGraduationApplyRecordByMap(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return graduationApplyRecordMapper.getGraduationApplyRecordByMap(map);
    }

    @Override
    public Long getGraduationApplyRecordCountByMap(Map<String, Object> map) {
        return graduationApplyRecordMapper.getGraduationApplyRecordCountByMap(map);
    }

    @Override
    public Map<String, Object> getHistoryUserId(Long user_id) {
        return graduationApplyRecordMapper.getHistoryUserId(user_id);
    }
}
